/**
 * Copyright (C) 2012 The SkyTvOS Project
 * <p/>
 * Version     Date           Author
 * ─────────────────────────────────────
 * 2015年1月5日         luwei
 */

package com.coocaa.launcher.sidebar.setting;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.view.Gravity;
import android.view.View;

import com.coocaa.launcher.framework.sidebar.ContainerLayout;
import com.coocaa.launcher.framework.sidebar.ItemContainer;
import com.coocaa.launcher.framework.sidebar.item.ItemFactory.ITEM;
import com.coocaa.launcher.sidebar.SettingData;
import com.coocaa.launcher.sidebar.left.LeftSideSettingContainerLayout;

public class DeskSettingLayout extends SettingLayout {
    public DeskSettingLayout(Context context, String type) {
        super(context, type);
        // TODO Auto-generated constructor stub
    }

    @Override
    public View getContentView() {
        ItemContainer container = new SettingContainer(mContext, mType);
        LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, Gravity.CENTER);
        container.getLayout().setLayoutParams(params);
        container.showLayout();
        return container.getLayout();
    }

    @Override
    public ItemContainer getTitleItemContainer() {
        return new LeftDeskSettingContainer(mContext);
    }

    class LeftDeskSettingContainer extends ItemContainer {

        public LeftDeskSettingContainer(Context context) {
            super(context, DeskSettingLayout.this.mType);
            // TODO Auto-generated constructor stub
        }

        @Override
        public ContainerLayout createLayout() {
            // TODO Auto-generated method stub
            return new LeftSideSettingContainerLayout(mContext);
        }

        @Override
        public List<SettingData> getSettingDatas() {
            List<SettingData> datas = new ArrayList<SettingData>();
            SettingData data = new SettingData();
            data.iconId = mType;
            data.titleId = mType;
            data.type = ITEM.COMMON.toString();
            datas.add(data);
            return datas;
        }

    }
}
